﻿using DemoApp.Controller;
using DemoApp.CustomerModule.ViewModel;
using DemoApp.ViewModel;
using Microsoft.Practices.Unity;

namespace DemoApp.CustomerModule.Controller
{
    [Controller]
    public class CustomersController
    {
        private readonly IMainWindowViewModel _mainWindowViewModel;

        public CustomersController(IMainWindowViewModel mainWindowViewModel)
        {
            _mainWindowViewModel = mainWindowViewModel;
        }

        [InjectionMethod]
        public void Initialize(ViewAllCustomersViewModel viewAllCustomersViewModel,
                               CreateNewCustomerViewModel createNewCustomerViewModel)
        {
            _mainWindowViewModel.AddCommand(viewAllCustomersViewModel);
            _mainWindowViewModel.AddCommand(createNewCustomerViewModel);
        }
    }
}